package com.zhiyou.app.pojo.enums;


import java.util.Arrays;

/**
 * @Description 删除枚举
 * @Author : bind
 * @Date : 2022-06-14 14:41
 */
public enum DeletedEnum {

    /**
     *
     */
    DELETED(1, "已删除"),
    NO_DELETED(0, "未删除");

    public Integer code;
    public String name;

    DeletedEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static boolean contains(String s) {
        return Arrays.stream(DeletedEnum.values()).map(DeletedEnum::toString).anyMatch(s::equals);
    }

    @Override
    public String toString() {
        return String.valueOf(this.code);
    }
}
